package com.qf.pojo;

/**
 * @author Kuke
 * @date 2022/3/12 11:51
 * 订单项实体
 */
public class OrderItem {

   /* `itemid` varchar(32) NOT NULL,
  `count` int DEFAULT NULL,
            `subtotal` double DEFAULT NULL,
            `pid` varchar(32) DEFAULT NULL,
  `oid` varchar(32) DEFAULT NULL,*/
    private String itemid ; //订单项的编号
    private Integer count ; //订单项包含商品数量
    private Double subtotal ; //小计金额
    private Product product ;// 包含哪个商品
    private Order order ; //这个订单项属于哪个订单的

    public String getItemid() {
        return itemid;
    }

    public void setItemid(String itemid) {
        this.itemid = itemid;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    //小计金额可以计算的
    public Double getSubtotal() {
       // return subtotal;
        return this.count * product.getShop_price() ;
    }

    public void setSubtotal(Double subtotal) {
        this.subtotal = subtotal;
    }

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    public Order getOrder() {
        return order;
    }

    public void setOrder(Order order) {
        this.order = order;
    }
}
